package com.sunjy.common.utils.DelayDueque;

import java.util.Date;
import java.util.concurrent.TimeUnit;

/**
 * Created by Renliwo on 2018/6/21.
 */
public class DataDemo implements Runnable{

    private String orderId;

    public DataDemo(String orderId){
        this.orderId=orderId;
    }

    @Override
    public void run() {
        //超时，把当前的订单置为关闭

        System.out.println("超时，我要撤销订单啦~~~~~~~"+"##########################"+new Date().toString());
    }

    public static void main(String[] args) {
        ItemQueueThread ith=ItemQueueThread.getInstance();
        DataDemo dd=new DataDemo("111111111111");//创建一个任务对象
        ith.put(10, dd, TimeUnit.SECONDS);//将任务对象添加到队列中


    }
}
